<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <title>文章分类</title>
  <t:base type="jquery,easyui,tools"></t:base>
  <script type="text/javascript" src="${webRoot}/plug-in/ajaxfileupload/ajaxfileupload.js"></script>
  <script type="text/javascript">
    $(function() {
      $('#cc').combotree({
        url : 'articleCategoryController.do?setPFunction',
        width: 155,
        onSelect : function(node) {
                //alert(node.text);

          var pId = 0;
          if(node.id != ""){
            pId = node.id;
          }
        //  $("#hierarchical").val(node.attributes.href);
          $("#pId").val(pId);

        }
      });

      if('${category.id }' != null && '${category.id }' != '') {
        $('#cc').combotree('disable');
      }

      if($("#pId").val() == ""){
        $("#pId").val("0");
      }

      if($("#cc").val() == "0"){
        $('#cc').combotree('setValue', '');
      }

      if('${empty pid}' == 'false') { // 设置新增页面时的父级
        $('#cc').combotree('setValue', '${pid}');

      }
    });


  </script>
</head>
<body style="overflow-y: hidden" scroll="no">
<t:formvalid formid="formobj" layout="div" dialog="true" action="articleCategoryController.do?save">
  <input id="id" name="id" type="hidden" value="${category.id }">
  <fieldset class="step">
    <div class="form">
      <label class="Validform_label"> 标题: </label>
      <input name="title" class="inputxt" value="${category.title}"  datatype="s1-20">
      <span class="Validform_checktip">标题范围1~20位字符</span>
    </div>
    <div class="form">
      <label class="Validform_label"> 副标题: </label>
      <input name="subtitle" class="inputxt" value="${category.subtitle}" >
    </div>
    <div class="form">
      <label class="Validform_label"> 上级分类: </label>
      <input id="cc" name="cc" value="${category.tArticleCategoryEntity.id}">
      <input type="hidden" id="pId" name="tArticleCategoryEntity.id" value="${category.tArticleCategoryEntity.id}">
    </div>
    <div class="form">
      <label class="Validform_label">展示平台:</label>
      <t:dictSelect field="publishPlat"  type="checkbox" typeGroupCode="supportSys" defaultVal="${category.publishPlat}"
                    hasLabel="false" extendJson="{datatype='*'}" >
      </t:dictSelect>
      <span class="Validform_checktip"></span>
    </div>
  </fieldset>
</t:formvalid>
</body>
</html>
